#include <iostream>
#include <memory>
#include <string>
#include "db_grpc_client.h"

int main() {

	std::string ip;
	std::cout << "ip:" << std::endl;
	std::cin >> ip;

	std::string port;
	std::cout << "port:" << std::endl;
	std::cin >> port;


	dbClient client(grpc::CreateChannel(ip + ":" + port, grpc::InsecureChannelCredentials()));

	std::cout << client.userSearchByID(2110551202) << std::endl;
	std::cout << client.userGetNameByID(2110551202) << std::endl;
	client.userUpdateNameByID(2110551202, "甘劲搏");
	std::cout << client.userGetNameByID(2110551202) << std::endl;
	std::cout << client.user_infoGetInfoByID(2110551202).info << std::endl;
	std::cout << client.message_logGetMessageByUserID(2110551202) << std::endl;
	std::cout << client.friend_tableGetFriendsByUserID(2110551202) << std::endl;
	std::cout << client.server_logGetLogByID(1).data << std::endl;
	client.userUpdateNameByID(2110551202, "甘劲博");

	return 0;
}